<?php
class ArticlesControllerTest extends ControllerTestCase {
	public $fixtures = array('app.article');

	public function testIndex() {
		$result = $this->testAction('/articles/index');
		debug($result);
	}

	public function testIndexShort(){
		$result = $this->testAction('/articles/index/short');
		debug($result);
	}

	public function testIndexShortGetRenderedHtml(){
		$result = $this->testAction(
			'/articles/index/short',
			array('return'=> 'contents')
		);
		debug($result);
	}

	public function testIndexShortGetViewVars(){
		$result = $this->testAction(
			'/articles/index/short',
			array('return'=>'vars') 
		);
		debug($result);
	}

	public function testIndexPostData(){
		$data = array(
			'Article' => array(
				'id' => 1,
				'published' => 1,
				'title' => 'New Article',
				'body' => 'New Body',
			)
		);
		$result = $this->testAction(
			'/articles/index',
			array('data'=>$data, 'method'=>'post') 
		);
		debug($result);
	}	
	public function testAdding(){
		$data = array(
			'Post' => array(
				'title' => 'New Post',
				'body' => 'Secret sauce'
			)
		);
		$this->testAction('/articles/add', array('data'=>$data, 'method'=>'get'));
		//some assertions
	}

}
